package com.cskaoyan.controller;

import com.cskaoyan.bean.promotion.Topic;
import com.cskaoyan.service.promotion.TopicService;
import com.cskaoyan.vo.BaseRespVo;
import com.cskaoyan.vo.promotion.WxTopicDetailVo;
import com.cskaoyan.vo.promotion.WxTopicListVo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * @description:
 * @autyor:caicaicai
 */
@RestController
public class WxTopicController {

    @Autowired
    TopicService topicService;

    @RequestMapping("/wx/topic/list")//?page=1&size=10
    public BaseRespVo list(Integer page, Integer size){
        WxTopicListVo wxTopicListVo = topicService.listWx(page, size);
        return BaseRespVo.ok(wxTopicListVo);
    }

    @RequestMapping("/wx/topic/detail")
    public BaseRespVo detail(Integer id){
        WxTopicDetailVo wxTopicDetailVo = topicService.detailWx(id);
        return BaseRespVo.ok(wxTopicDetailVo);
    }

    @RequestMapping("/wx/topic/related")
    public BaseRespVo wxTopicRelated(Integer id){
        List<Topic> topicList = topicService.related(id);
        return BaseRespVo.ok(topicList);
    }



}
